import request from '@/utils/request';
import { HTTP_METHOD } from '@/utils/http';

const BASE_URL = '/user';

/**
 * 获取风控值
 * @return {*}
 */
export function getLimits() {
  return request({
    url: `${BASE_URL}/limits`,
    method: HTTP_METHOD.GET,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API
  });
}

/**
 * 获取配置值
 * @return {*}
 */
 export function getSettingsLimits() {
  return request({
    url: `${BASE_URL}/max`,
    method: HTTP_METHOD.GET,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API
  });
}

/**
 * @export 获取用户还款详情
 * @param {*} tid
 */
export function getRepayments(task_id) {
  return request({
    url: `${BASE_URL}/repaymentlist`,
    method: HTTP_METHOD.POST,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
    data: {
      task_id
    }
  });
}

/**
 * @export 获取用户当前还款
 * @param {*} tid
 */
 export function getCurrentRepayments() {
  return request({
    url: `${BASE_URL}/repaymentlist`,
    method: HTTP_METHOD.GET,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API
  });
}
